<template>
  <div class="box-content">
    <div class="aside-content">
      <el-container>
        <el-header>
          <div class="card" style="margin-bottom: 5px; margin-top: 20px">
            <el-button type="primary" @click="refreshRank">刷新排名</el-button>
            <el-button type="primary">打印奖状</el-button>
            <el-button type="primary">打印排名</el-button>
            <el-button type="info" style="margin: 0 10px">重置</el-button>
          </div>
        </el-header>
        <el-main>
          <el-table :data="tableData" border stripe style="width: 100%">
            <el-table-column label="排名" prop="rankId" width="70px">
              <template #default="scope">
                <span v-if="scope.row.rankId <= 3" class="ranking-position top-three">{{
                  scope.row.rankId
                }}</span>
                <span v-else class="ranking-position">{{ scope.row.rankId }}</span>
              </template>
            </el-table-column>
            <el-table-column label="选手编号" prop="id"></el-table-column>
            <el-table-column label="选手姓名" prop="name"></el-table-column>
            <el-table-column label="选手得分" prop="score"></el-table-column>
            <el-table-column label="超时时长" prop="timeOver"></el-table-column>
          </el-table>
        </el-main>
        <el-footer style="display: flex; justify-content: flex-end">
          <!-- <el-button type="primary">保存</el-button> -->
        </el-footer>
      </el-container>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const tableData = ref([])

const refreshRank = () => {
  console.log('刷新排名')
  tableData.value = []
}
</script>

<style>
.box-content {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;

  height: 100%;
  width: 100%;
}

.aside-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  margin: 0 15px;
  height: 90%;
  width: 90%;
  border-radius: 10px;
  box-shadow: 2px 2px 5px #888888;
  background-color: white;
}

.ranking-title {
  text-align: center;
  font-size: 24px;
  color: #333;
}

.ranking-list {
  list-style: none;
  padding: 0;
}

.ranking-list li {
  border-bottom: 1px solid #eee;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ranking-list li:last-child {
  border-bottom: none;
}

.ranking-position {
  color: #666;
  font-size: 22px;
  font-weight: bold;
}

.ranking-name {
  font-size: 18px;
  color: #333;
}

.ranking-value {
  font-size: 16px;
  color: #555;
}
.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 10px;
}

.top-three {
  color: #ff6700; /* 鲜艳的颜色 */
}
</style>
